import 'package:flutter/material.dart';
import 'package:flutterapp/chapter/twelve/12_3_platform_view.dart';
import 'package:flutterapp/utils/navigator_utils.dart';

import '12_1_battery_plugin.dart';
import '12_2_camera.dart';

/// @date 2020/08/26  17:43
/// @author 程志强
/// @des 包和插件

class TwelveMain extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("包和插件"),
      ),
      body: Container(
        margin: const EdgeInsets.symmetric(horizontal: 20),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            RaisedButton(
                child: Text("获取系统电量插件"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, BatteryPluginRoute())),
            RaisedButton(
                child: Text("拍照"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, CameraRoute())),
            RaisedButton(
                child: Text("WebView"),
                onPressed: () =>
                    NavigatorUtil.goPageByPush(context, PlatformViewRoute())),
          ],
        ),
      ),
    );
  }
}
